import {defineStore} from 'pinia'
import {reactive} from "vue";

export const useHomeStore = defineStore('home', () => {
    const data = reactive({
        baseCategoryList: [],
        navList: [
            {
                name: '服装城',
                link: 'javascript:'
            },
            {
                name: '美妆馆',
                link: 'javascript:'
            },
            {
                name: '尚品汇超市',
                link: 'javascript:'
            },
            {
                name: '全球购',
                link: 'javascript:'
            },
            {
                name: '闪购',
                link: 'javascript:'
            },
            {
                name: '团购',
                link: 'javascript:'
            },
            {
                name: '有趣',
                link: 'javascript:'
            },
            {
                name: '秒杀',
                link: 'javascript:'
            }
        ],
        news: [
            {
                classification: '特惠',
                content: '备战开学季 全民半价购数码'
            },
            {
                classification: '公告',
                content: '备战开学季 全民半价购数码'
            },
            {
                classification: '特惠',
                content: '备战开学季 全民半价购数码'
            },
            {
                classification: '公告',
                content: '备战开学季 全民半价购数码'
            },
            {
                classification: '特惠',
                content: '备战开学季 全民半价购数码'
            },
        ],
        services: [
            '话费', '机票', '电影票', '游戏', '彩票', '加油站', '酒店', '火车票', '众筹', '理财', '礼品卡', '白条',
        ],
        recommend: {
            title: '今日推荐',
            titlePic: '/images/home/clock.png',
            description: '',
            bannerPics: [
                {
                    url: '/images/home/today01.png',
                    description: ''
                },
                {
                    url: '/images/home/today02.png',
                    description: ''
                },
                {
                    url: '/images/home/today03.png',
                    description: ''
                },
                {
                    url: '/images/home/today04.png',
                    description: ''
                },

            ]
        },
        rank: {
            titles: [
                {
                    title: '热卖排行',
                    on: true
                },
                {
                    title: '特价排行',
                    on: false
                },
                {
                    title: '新品排行',
                    on: false
                },
            ],
            items: [
                {
                    pic: '/images/home/1.jpg',
                    description: '',
                    content: '【官网价直降1100】Apple iPhone 8 Plus 256GB 银色 移动联通电信4G手机',
                    price: '100.00'
                },
                {
                    pic: '/images/home/1.jpg',
                    description: '',
                    content: '【官网价直降1100】Apple iPhone 8 Plus 256GB 银色 移动联通电信4G手机',
                    price: '100.00'
                },
                {
                    pic: '/images/home/1.jpg',
                    description: '',
                    content: '【官网价直降1100】Apple iPhone 8 Plus 256GB 银色 移动联通电信4G手机',
                    price: '100.00'
                },
                {
                    pic: '/images/home/1.jpg',
                    description: '',
                    content: '【官网价直降1100】Apple iPhone 8 Plus 256GB 银色 移动联通电信4G手机',
                    price: '100.00'
                },
            ],
        },
        like: {
            title: '猜你喜欢',
            items: [
                {
                    pic: '/images/home/like_01.png',
                    description: '',
                    content: '阳光美包新款单肩包女包时尚子母包四件套女',
                    price: '116.00'
                },
                {
                    pic: '/images/home/like_02.png',
                    description: '',
                    content: '阳光美包新款单肩包女包时尚子母包四件套女',
                    price: '116.00'
                },
                {
                    pic: '/images/home/like_03.png',
                    description: '',
                    content: '阳光美包新款单肩包女包时尚子母包四件套女',
                    price: '116.00'
                },
                {
                    pic: '/images/home/like_01.png',
                    description: '',
                    content: '阳光美包新款单肩包女包时尚子母包四件套女',
                    price: '116.00'
                },
                {
                    pic: '/images/home/like_02.png',
                    description: '',
                    content: '阳光美包新款单肩包女包时尚子母包四件套女',
                    price: '116.00'
                },
                {
                    pic: '/images/home/like_03.png',
                    description: '',
                    content: '阳光美包新款单肩包女包时尚子母包四件套女',
                    price: '116.00'
                },
            ]
        },
        brands: [
            {
                pic: '/images/home/brand_21.png',
                description: ''
            },
            {
                pic: '/images/home/brand_03.png',
                description: ''
            },
            {
                pic: '/images/home/brand_05.png',
                description: ''
            },
            {
                pic: '/images/home/brand_07.png',
                description: ''
            },
            {
                pic: '/images/home/brand_09.png',
                description: ''
            },
            {
                pic: '/images/home/brand_11.png',
                description: ''
            },
            {
                pic: '/images/home/brand_13.png',
                description: ''
            },
            {
                pic: '/images/home/brand_15.png',
                description: ''
            },
            {
                pic: '/images/home/brand_17.png',
                description: ''
            },
            {
                pic: '/images/home/brand_19.png',
                description: ''
            },
        ]
    })
    let createCategory = (arr) => {
        data.baseCategoryList = arr
    }

    return {
        data, createCategory
    }
})
